package sgi.client;

import javax.swing.JFrame;
import java.awt.GridBagLayout;
import javax.swing.JLabel;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.sql.SQLException;

import javax.swing.JFrame;
import javax.swing.JLabel;

import com.sun.rowset.CachedRowSetImpl;



public class MonthlyDatabaseReportPanel extends JFrame {

	public MonthlyDatabaseReportPanel(CachedRowSetImpl reportInfo) throws SQLException{
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		reportInfo.next();
		setTitle("SGI Monthly Database State Report");
		GridBagLayout gridBagLayout = new GridBagLayout();
		gridBagLayout.columnWidths = new int[]{0, 0, 0, 0, 0};
		gridBagLayout.rowHeights = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
		gridBagLayout.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
		gridBagLayout.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
		getContentPane().setLayout(gridBagLayout);
		
		JLabel lblDate = new JLabel("Date: ");
		GridBagConstraints gbc_lblDate = new GridBagConstraints();
		gbc_lblDate.insets = new Insets(0, 0, 5, 5);
		gbc_lblDate.gridx = 1;
		gbc_lblDate.gridy = 1;
		getContentPane().add(lblDate, gbc_lblDate);
		
		JLabel lblAdate = new JLabel("aDate");
		if (reportInfo != null)
			lblAdate.setText(reportInfo.getString(1));
		GridBagConstraints gbc_lblAdate = new GridBagConstraints();
		gbc_lblAdate.insets = new Insets(0, 0, 5, 5);
		gbc_lblAdate.gridx = 2;
		gbc_lblAdate.gridy = 1;
		getContentPane().add(lblAdate, gbc_lblAdate);
		
		JLabel lblArchiveSize = new JLabel("Archive Size: ");
		GridBagConstraints gbc_lblArchiveSize = new GridBagConstraints();
		gbc_lblArchiveSize.insets = new Insets(0, 0, 5, 5);
		gbc_lblArchiveSize.gridx = 2;
		gbc_lblArchiveSize.gridy = 4;
		getContentPane().add(lblArchiveSize, gbc_lblArchiveSize);
		
		JLabel lblAarchivesize = new JLabel("aArchiveSize");
		if (reportInfo != null)
			lblAarchivesize.setText(reportInfo.getString(2));
		GridBagConstraints gbc_lblAarchivesize = new GridBagConstraints();
		gbc_lblAarchivesize.insets = new Insets(0, 0, 5, 0);
		gbc_lblAarchivesize.gridx = 3;
		gbc_lblAarchivesize.gridy = 4;
		getContentPane().add(lblAarchivesize, gbc_lblAarchivesize);
		
		JLabel lblNewImages = new JLabel("New Images: ");
		GridBagConstraints gbc_lblNewImages = new GridBagConstraints();
		gbc_lblNewImages.insets = new Insets(0, 0, 5, 5);
		gbc_lblNewImages.gridx = 2;
		gbc_lblNewImages.gridy = 6;
		getContentPane().add(lblNewImages, gbc_lblNewImages);
		
		JLabel lblAnewimages = new JLabel("aNewImages");
		if (reportInfo != null)
			lblAnewimages.setText(reportInfo.getString(3));
		GridBagConstraints gbc_lblAnewimages = new GridBagConstraints();
		gbc_lblAnewimages.insets = new Insets(0, 0, 5, 0);
		gbc_lblAnewimages.gridx = 3;
		gbc_lblAnewimages.gridy = 6;
		getContentPane().add(lblAnewimages, gbc_lblAnewimages);
		
		JLabel lblPurchasedImages = new JLabel("Purchased Images: ");
		GridBagConstraints gbc_lblPurchasedImages = new GridBagConstraints();
		gbc_lblPurchasedImages.insets = new Insets(0, 0, 0, 5);
		gbc_lblPurchasedImages.gridx = 2;
		gbc_lblPurchasedImages.gridy = 8;
		getContentPane().add(lblPurchasedImages, gbc_lblPurchasedImages);
		
		JLabel lblApurchasedimages = new JLabel("aPurchasedImages");
		if (reportInfo != null)
			lblApurchasedimages.setText(reportInfo.getString(4));
		GridBagConstraints gbc_lblApurchasedimages = new GridBagConstraints();
		gbc_lblApurchasedimages.gridx = 3;
		gbc_lblApurchasedimages.gridy = 8;
		getContentPane().add(lblApurchasedimages, gbc_lblApurchasedimages);
		// TODO Auto-generated constructor stub
	}



}
